package robotutils.planning;

import java.io.Serializable;

public final class StateKey<State> implements Serializable {
    
    /**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	final State s;
    Key k;

    public StateKey(State s, Key k) {
        this.s = s;
        this.k = k;
    }

    @Override
    @SuppressWarnings("EqualsWhichDoesntCheckParameterClass")
    public boolean equals(Object obj) {
        // We do a dangerous unchecked comparison (no null-test, etc.)
        // because this is a private class and should be well-behaved.
        StateKey that = (StateKey)obj;
        return (this.s.equals(that.s));
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 53 * hash + (this.s != null ? this.s.hashCode() : 0);
        return hash;
    }

    @Override
    public String toString() {
        return "[" + s.toString() + "," + k.toString() + "]";
    }
}